<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <div th:fragment="nav">
        <!-- 导航栏-->
        <div style="border:2px slateblue solid">
            <h2 align="center">基于SpringBoot2.7.x MyBatis2.3.x Thymeleaf 的学生成绩简易系统-Mark5</h2>
            <hr>
            <div style="display: flex; justify-content: space-between">
                <h4><a href="/mark5/go2login">学生成绩简易系统-首页</a></h4>
                <div  style="width: 50%; display: flex;  align-content: right;  justify-content: space-between; padding-top: 12px">
                    <p th:if="${ session.user== null}" style="color: #aabec5">
                        未登录</p>
                    <p  th:if="${ session.user!= null}"style="color: orangered">
                        已登录</p>
                    <p style="color: blue" >姓名:
                        <span th:if="${session.user!=null}" th:text="${session.user.uname}"></span></p>
                    <p style="color: blueviolet">角色:<span th:if="${session.user!=null}" th:text="${session.user.role}"></span></p>

                </div>
                <p style="color: blue"><a href="/mark5/logout.do">退出</a></p>
                <div th:if="${session.user!= null}" style="width: 5vw; height: 5vw">
                    <img style="height: 90%; width: 100% " th:src="'/mark5/showimg/'+ ${session.user.pic}"/>
                </div>
                <p>&nbsp;</p>
            </div>
        </div>
        <!--<hr>-->
    </div>




 <div th:if="${session.user!=null &&session.user.role=='adm'}">
    <h2 style="display: flex; justify-content: space-around">课程安排</h2>
    <hr>
</div>
<div style="display: flex;justify-content: space-around">
    <div>
        <h2 style="display: flex; justify-content: space-around">课程安排信息</h2>
        <table  width="120%" border="1" cellspacing="0" style="line-height: 36px">
        <tr>
            <td align="center">教师Id</td>
            <td align="center"> 教师姓名</td>
            <td align="center">班级编号</td>
            <td align="center">班级名</td>
            <td align="center"> 课程编号</td>
            <td align="center">课程名字</td>
            <td align="center">功能</td>
        <!--align="center" 水平居中-->
        </tr>
        <tr th:each="x:${tasks}">
            <td th:text="${x.user.uid}"></td>
            <td align="center" th:text="${x.user.uname}"></td>
            <td align="center" th:text="${x.user.clz.clzno}"></td>
            <td th:text="${x.user.clz.clzname}"></td>
            <td align="center" th:text="${x.course.cno}"></td>
            <td align="center" th:text="${x.course.cname}"></td>
            <td><a th:href="'/task/del/'+${x.kid}">删除</a></td>
        </tr>
    </table>
    </div>

    <div>
        <h2 style="display: flex; justify-content: space-around">安排新课程</h2>
    <form action="/task/add" method="post">
          教师: <select name="uid">
          <option th:each="x:${teas}"
                  th:text="${x.uname}"
                  th:value="${x.uid}">
          </option>
        </select><br>
         班级:<select name="clzno">
          <option th:each="x:${clzs}"
                  th:text="${x.clzname}"
                  th:value="${x.clzno}">
          </option>
         </select><br>
        课程:<select name="cno">
         <option  th:each="x:${cours}"
                  th:text="${x.cname}"
                  th:value="${x.cno}">
         </option>
    </select><br>
            <input type="submit" value="安排新课程">
    </form>
    </div>
</div>
</div>
</body>
</html>